import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hook_up_rent/pages/home/widgets/recommend.dart';
import 'package:hook_up_rent/widgets/common_image.dart';

var textStyle = TextStyle(fontWeight: FontWeight.w500,fontSize: 16);

class RecommendItem extends StatelessWidget {
  final HomeRecommendItem recommendItem;
  const RecommendItem(this.recommendItem,{Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        Navigator.pushNamed(context, recommendItem.navigateUri);
      },
      child: Container(
        padding: EdgeInsets.all(10),
        height: 100.0,
        decoration: BoxDecoration(color: Colors.white),
        width: (MediaQuery.of(context).size.width - 10.0 * 3) / 2,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(recommendItem.title,style: textStyle,),
                Text(recommendItem.subTitle,style: textStyle,)
              ],
            ),
            CommonImage(recommendItem.imageUri,width: 65,)
          ],
        ),
      ),
    );
  }
}
